<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAutoLockTasksTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('auto_lock_tasks', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('agent_id')->comment('所属代理ID');
            $table->bigInteger('product_id')->comment('监测的商品ID');
            $table->string('product_name')->comment('监测的商品名称');
            $table->string('contract_address', 128)->comment('商品链上标识');
            $table->dateTime('start_time')->comment('监测开始时间');
            $table->dateTime('end_time')->comment('监测戴上时间');
            $table->integer('min_price')->comment('最低锁定价格');
            $table->integer('max_price')->comment('最高锁定价格');
            $table->integer('lock_minutes')->comment('锁定时间,分钟');
            $table->string('locker_account')->comment('锁单使用的手机号');
            $table->bigInteger('locker_user_id')->comment('锁单使用的用户ID');
            $table->integer('locked_count')->default(0)->comment('已锁单数量');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('auto_lock_tasks');
    }
}
